import request from '@/utils/request'

// 查询优惠券档期列表
export function listGeneration(query) {
  return request({
    url: '/ypp/generation/list',
    method: 'get',
    params: query
  })
}

// 查询优惠券档期详细
export function getGeneration(id) {
  return request({
    url: '/ypp/generation/' + id,
    method: 'get'
  })
}

// 新增优惠券档期
export function addGeneration(data) {
  return request({
    url: '/ypp/generation',
    method: 'post',
    data: data
  })
}

// 修改优惠券档期
export function updateGeneration(data) {
  return request({
    url: '/ypp/generation',
    method: 'put',
    data: data
  })
}

// 删除优惠券档期
export function delGeneration(id) {
  return request({
    url: '/ypp/generation/' + id,
    method: 'delete'
  })
}

// 导出优惠券档期
export function exportGeneration(query) {
  return request({
    url: '/ypp/generation/export',
    method: 'get',
    params: query
  })
}